package com.itheima.reggie.controller;

import com.itheima.reggie.DishService;
import com.itheima.reggie.common.ResultInfo;
import com.itheima.reggie.domain.Dish;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
public class DishController {
    @Autowired
    private DishService dishService;

    //查询
   @GetMapping("/dish/list")
    public ResultInfo findById(Long categoryId,Integer status){
     List<Dish>list=  dishService.findById(categoryId,status);
     return ResultInfo.success(list);
   }
}
